import request from "../utils/request";

export function getUploadTaskList(param) {
  return request({
    url: '/bjgl/b-file-upload-task/list',
    method: 'get',
    params: param

  })
}

//创建上传任务
export function addUploadTask(param) {
  return request({
    url: '/bjgl/b-file-upload-task/add',
    method: 'post',
    data: param
  })
}
//获取上传识别码
export function addUploadTaskCode(param) {
  return request({
    url: '/bjgl/b-file-upload-task/getUrl',
    method: 'get',
    params: param
  })
}

//获取任务文件列表
export function getFileList(param) {
  return request({
    url: '/bjgl/b-file-upload/fileList',
    method: 'get',
    params: param
  })
}

//获取个人上传文件列表
export function getPersonalFileList(param) {
  return request({
    url: '/bjgl/b-file-upload/personalFileList',
    method: 'get',
    params: param
  })
}
//打包获取文件
export function getFileForPackage(param) {
  return request({
    url: '/bjgl/b-file-upload/downloadAll',
    method: 'get',
    params: param
  })
}

//下载文件
export function downLoad(param) {
  return request({
    url: '/bjgl/b-file-upload/download',
    method: 'get',
    params: param
  })
}

//删除文件
export function removeFile(param) {
  return request({
    url: '/bjgl/b-file-upload/removeFile',
    method: 'post',
    data: param
  })
}

//删除任务
export function removeTask(param) {
  return request({
    url: '/bjgl/b-file-upload-task/delete',
    method: 'post',
    data: param
  })
}

//根据文件码下载文件
export function downloadFileByCode(fileCode) {
  return request({
    url: `/bjgl/b-file-upload/downloadByCode/${fileCode}`,
    method: 'get'
  })
}
